package Ep01_Array.Feb23rd_0709;

/**
 * @author Jimmy Zhan WORKSTATION
 * @Date 2023/2/23 9:59
 * 说明：字符串转换成小写：利用大小写在 ASCII码差 32位
 */

public class Another {

    public static void main(String[] args) {
        String s = "HellO";
        Another a = new Another();
        System.out.println(a.toLowerCase(s));
    }

    public String toLowerCase(String s){
        char[] c1 = s.toCharArray();
        for (int i = 0; i < c1.length; i++) {
            if (c1[i] >= 'A' && c1[i] <= 'Z'){
                c1[i] += 32;
            }
        }

        return String.valueOf(c1);
    }
}
